<?php namespace Summer\Hjd\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

class BuilderTableCreateSummerHjdDetailedScore extends Migration
{
    public function up()
    {
        Schema::create('summer_hjd_detailed_score', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id')->unsigned();
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
            $table->integer('user_id');
            $table->integer('relate_user_id');
            $table->string('change_slug');
            $table->decimal('money', 14, 2)->default(0.00);
            $table->decimal('money_before', 14, 2)->default(0.00);
            $table->decimal('money_after', 14, 2)->default(0.00);
            $table->integer('inout');
            $table->string('comment')->nullable();
            $table->integer('status')->nullable()->default(1);
            $table->integer('table_id')->nullable();
            $table->string('table_name')->nullable();
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('summer_hjd_detailed_score');
    }
}
